const fbId = "305586146250869"; 
const fbSecret = "abcad469fe8b25652c19634908d318b4"; 

const fbCallbackAddress= "http://localhost:4000/auth/facebook";
var 
	app 					= require('express')(),
	http					= require('http'),
	server 					= http.createServer(app),
  	request					= require('request'),
  	winston 				= require('winston'),
  	io 						= require('socket.io').listen(server),
  	Facebook 				= require('facebook-node-sdk');





serverConfig();
	var facebook = new Facebook({ appID: fbId, secret: fbSecret });
		facebook.api('', function(err, data) {
	  		console.log(data); // => { id: ... }
	  		console.log(err);
		});

io.sockets.on('connection', function (socket){

	io.socket.on('azul',function(token){

	});

});


function serverConfig(){
	try{
		PORT		= 5030;
		server.listen(PORT);
	}
	catch(error){
		console.log(error);
		terminateServer(1);
	}
}


function terminateServer(exitCode){
	process.exit(exitCode);
}
